package com.sx.gongzhong.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.sx.gongzhong.BaseActivity;
import com.sx.gongzhong.R;
import com.sx.gongzhong.adapter.ImageAdapter;
import com.sx.gongzhong.model.LetterBean;
import com.sx.gongzhong.model.PhotoBean;
import com.sx.gongzhong.widget.InnerListView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 我的信访举报详情
 * Created by admin on 2018/1/5.
 */

public class MyLettersDetailActivity extends BaseActivity {
    @BindView(R.id.tv_Time)
    TextView tvTime;
    @BindView(R.id.tv_Content)
    TextView tvContent;
    @BindView(R.id.imgListView)
    InnerListView imgListView;
    @BindView(R.id.tv_handleStatus)
    TextView tvHandleStatus;

    @Override
    public void setUI(Bundle savedInstanceState) {
        setContentView(R.layout.activity_my_letter_detail);
        setTitleName("信访举报详情");
        ButterKnife.bind(this);

        LetterBean letterBean = (LetterBean) getIntent().getSerializableExtra("letterBean");
        tvTime.setText(letterBean.getReportTime());
        tvContent.setText(letterBean.getContent());

        if (letterBean.getHandleState().equals("to_be_solved")){
            tvHandleStatus.setText("待解决");
            tvHandleStatus.setBackgroundResource(R.drawable.shape_red_corner_50);
        }else if (letterBean.getHandleState().equals("solved ")){
            tvHandleStatus.setText("已解决");
            tvHandleStatus.setBackgroundResource(R.drawable.shape_green_corner_50);
        }
        if (letterBean.getFiles() != null && letterBean.getFiles().size() > 0){
            ImageAdapter adapter = new ImageAdapter(this, R.layout.item_image, letterBean.getFiles());
            imgListView.setAdapter(adapter);
        }
    }
}
